package com.yowasa.xiuxian.engine.message.user;


import com.yowasa.xiuxian.annoations.CMD;
import com.yowasa.xiuxian.engine.message.CmdMessageHandler;
import com.yowasa.xiuxian.entity.bo.user.UserBO;
import com.yowasa.xiuxian.entity.bot.message.Message;
import com.yowasa.xiuxian.entity.mys.SendMessage;
import com.yowasa.xiuxian.service.helper.MessageHelper;
import com.yowasa.xiuxian.service.helper.UserHelper;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 处理新建用户
 */

@CMD(name = "/注销", outCmd = true)
public class DelUserHandler extends CmdMessageHandler {
    @Autowired
    private MessageHelper messageHelper;
    @Autowired
    private UserHelper userHelper;


    @Override
    public void execute(SendMessage message) {
        UserBO user = userHelper.checkOpUser(message);
        userHelper.delUser(user);
        messageHelper.replyMys(message, "注销成功！");
    }
    public String desc(){
        return new StringBuffer().append("注销自己的存档，尘归尘土归土，请慎重使用\n")
                .toString();

    }

}
